package dji.sampleV5.aircraft

import android.content.Intent
import android.os.Bundle
import androidx.activity.addCallback
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.commit
import dji.sampleV5.aircraft.util.ToastUtils

class WayPointV3Activity: AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_waypointv3)
        onBackPressedDispatcher.addCallback {
            moveTaskToBack(true)
            val live = resources.getString(dji.v5.ux.R.string.uxsdk_waypoint)
            val intoBackground = resources.getString(dji.v5.ux.R.string.uxsdk_has_into_background)
            ToastUtils.showToast(live + intoBackground)
        }
        supportFragmentManager.commit {
            add(R.id.main_info_fragment_container, AircraftMSDKInfoFragment())
        }
    }

    override fun onNewIntent(intent: Intent?) {
        super.onNewIntent(intent)
    }
}